package com.jc.service.usertask;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.jc.cds.model.CustomUserTask;
import com.jc.common.util.TaskType;
import com.jc.ds.base.service.BaseServiceImpl;
import com.jc.ds.mapper.BaseCustomMapper;
import com.jc.ds.model.UserTask;
import com.jc.framework.enums.Booleans;

@Service
public class UserTaskServiceImpl extends BaseServiceImpl<UserTask, CustomUserTask, Long> implements UserTaskService {

	@Override
	public BaseCustomMapper<CustomUserTask, Long> getCustomMapper() {
		return null;
	}

	public void addTask(String type,String businessData,String businessId, Booleans bool,String remark) {
		UserTask task = new UserTask();
		task.setCreateTime(new Date());
		task.setTaskType(TaskType.ADD_GAME_MONEY);
		task.setTaskData(businessData);
		task.setTaskBusinessId(businessId);
		task.setTaskExeTag(bool.getName());
		task.setExeCount(1);
		task.setMaxExeCount(5);
		if(StringUtils.isNotBlank(remark))task.setExtend1(remark);
		add(task, false);
	}

}
